var loc = (location.href.match(/maniaco=/i));
if (location.href.match(/^http:\/\/(www\.)?megaupload\.com/i) && loc) {
	addScript("mega");
} else if (location.href.match(/^http:\/\/(www\.)?hotfile\.com/i) && loc) {
	addScript("hotfile");
} else if (location.href.match(/^http:\/\/(www\.)?filesonic\.com/i) && loc) {
	addScript("fsonic");
} else if (location.href.match(/^http:\/\/(www\.)?bitshare\.com/i) && loc) {
	addScript("bitshare");
} else if (location.href.match(/^http:\/\/(www\.)?filefactory\.com/i) && location.href.match(/.mp4$/i)) {
	addScript("ffactory");
} else if (location.href.match(/^http:\/\/(www\.)?mediafire\.com/i)){
	addScript("mfire");
} else if (location.href.match(/^http:\/\/localhost/i)) {
	if (document.getElementById("reproductor")) {
		if (document.getElementById("reproductor").src.match(/sin_plugin/i)) {
			var video = document.getElementById("reproductor").src.split("?");
			document.getElementById("reproductor").src = "http://localhost/pelimaniaco/player/video/?"+video[1];
		}
	}
}
function addScript(id) { 
	var s = document.createElement('script');
	s.setAttribute("type","text/javascript");
	s.setAttribute("src", "http://localhost/pelimaniaco/plugins/servers/"+id+".js");
	document.getElementsByTagName("head")[0].appendChild(s);
}